package cn.trigram.mgb.ext;

import cn.trigram.mgb.MybatisGeneratorProperties;
import org.apache.commons.lang3.StringUtils;
import org.mybatis.generator.config.Context;

public abstract class AbstractAddTableGenerateContextCustomize extends AbstractContextCustomize {

  public AbstractAddTableGenerateContextCustomize(MybatisGeneratorProperties mgbProps) {

    super(mgbProps);
  }

  @Override
  public void customize(Context context) {

    if (StringUtils.isBlank(this.mgbProps.getJavaModelGeneratorRootClass())) {
      context.getJavaModelGeneratorConfiguration().getProperties().remove("rootClass");
    }

  }

}
